package com.ojoin.trade.common.web.domain;

 
import java.net.URI;
import java.util.Map;
import java.util.Set;

public class LdapSettingsResponse {

	boolean enabled;
	String systemUsername;
	String systemPassword;
	URI ldapUri;
	boolean useStartTls;
	boolean trustAllCertificates;
	boolean activeDirectory;
	String searchBase;
	String searchPattern;
	String displayNameAttribute;
	String defaultGroup;
	Map<String, String> groupMapping;
	String groupSearchBase;
	String groupIdAttribute;
	Set<String> additionalDefaultGroups;
	String groupSearchPattern;
	
	public boolean isEnabled() {
		return enabled;
	}
	public void setEnabled(boolean enabled) {
		this.enabled = enabled;
	}
	public String getSystemUsername() {
		return systemUsername;
	}
	public void setSystemUsername(String systemUsername) {
		this.systemUsername = systemUsername;
	}
	public String getSystemPassword() {
		return systemPassword;
	}
	public void setSystemPassword(String systemPassword) {
		this.systemPassword = systemPassword;
	}
	public URI getLdapUri() {
		return ldapUri;
	}
	public void setLdapUri(URI ldapUri) {
		this.ldapUri = ldapUri;
	}
	public boolean isUseStartTls() {
		return useStartTls;
	}
	public void setUseStartTls(boolean useStartTls) {
		this.useStartTls = useStartTls;
	}
	public boolean isTrustAllCertificates() {
		return trustAllCertificates;
	}
	public void setTrustAllCertificates(boolean trustAllCertificates) {
		this.trustAllCertificates = trustAllCertificates;
	}
	public boolean isActiveDirectory() {
		return activeDirectory;
	}
	public void setActiveDirectory(boolean activeDirectory) {
		this.activeDirectory = activeDirectory;
	}
	public String getSearchBase() {
		return searchBase;
	}
	public void setSearchBase(String searchBase) {
		this.searchBase = searchBase;
	}
	public String getSearchPattern() {
		return searchPattern;
	}
	public void setSearchPattern(String searchPattern) {
		this.searchPattern = searchPattern;
	}
	public String getDisplayNameAttribute() {
		return displayNameAttribute;
	}
	public void setDisplayNameAttribute(String displayNameAttribute) {
		this.displayNameAttribute = displayNameAttribute;
	}
	public String getDefaultGroup() {
		return defaultGroup;
	}
	public void setDefaultGroup(String defaultGroup) {
		this.defaultGroup = defaultGroup;
	}
	public Map<String, String> getGroupMapping() {
		return groupMapping;
	}
	public void setGroupMapping(Map<String, String> groupMapping) {
		this.groupMapping = groupMapping;
	}
	public String getGroupSearchBase() {
		return groupSearchBase;
	}
	public void setGroupSearchBase(String groupSearchBase) {
		this.groupSearchBase = groupSearchBase;
	}
	public String getGroupIdAttribute() {
		return groupIdAttribute;
	}
	public void setGroupIdAttribute(String groupIdAttribute) {
		this.groupIdAttribute = groupIdAttribute;
	}
	public Set<String> getAdditionalDefaultGroups() {
		return additionalDefaultGroups;
	}
	public void setAdditionalDefaultGroups(Set<String> additionalDefaultGroups) {
		this.additionalDefaultGroups = additionalDefaultGroups;
	}
	public String getGroupSearchPattern() {
		return groupSearchPattern;
	}
	public void setGroupSearchPattern(String groupSearchPattern) {
		this.groupSearchPattern = groupSearchPattern;
	}

	public   LdapSettingsResponse (boolean enabled,
             String systemUsername,
             String systemPassword,
            URI ldapUri,
            boolean useStartTls,
            boolean trustAllCertificates,
            boolean activeDirectory,
            String searchBase,
            String searchPattern,
            String displayNameAttribute,
            String defaultGroup,
             Map<String, String> groupMapping,
             String groupSearchBase,
             String groupIdAttribute,
             Set<String> additionalDefaultGroups,
             String groupSearchPattern) {
		
		this.systemUsername=systemUsername;
		this. systemPassword=systemPassword;
		this. ldapUri= ldapUri ;
		this. useStartTls=  useStartTls;
		this. trustAllCertificates=  trustAllCertificates;
		this. activeDirectory= activeDirectory ;
		this. searchBase=searchBase  ;
		this. searchPattern= searchPattern ;
		this. displayNameAttribute= displayNameAttribute ;
		this. defaultGroup= defaultGroup ;
		this. groupMapping= groupMapping ;
		this. groupSearchBase= groupSearchBase ;
		this. groupIdAttribute=groupIdAttribute  ;
		this.additionalDefaultGroups= additionalDefaultGroups ;
		this. groupSearchPattern= groupSearchPattern ;
		
			 
}
	
	public static LdapSettingsResponse emptyDisabled() {
        return new LdapSettingsResponse(false,
                                                  "",
                                                  "",
                                                  URI.create("ldap://localhost:389"),
                                                  false,
                                                  false,
                                                  false,
                                                  "",
                                                  "",
                                                  "",
                                                  "",
                                                  null,
                                                  null,
                                                  null,
                                                  null,
                                                  null);
    }
}
